//
//  SLMoreSetViewController.m
//  StarLight
//
//  Created by Duke.wu on 16/6/6.
//  Copyright © 2016年 Duke.Wu. All rights reserved.
//

#import "SLMoreSetViewController.h"
#import "PPTableView.h"
#import "SLAboutViewController.h"
#import "UMSocial.h"



@interface SLMoreSetViewController ()<PPTableViewInfoDelegate, UITextFieldDelegate,UMSocialUIDelegate>
@property (nonatomic, strong) PPTableViewInfo *tableViewInfo;

@end

@implementation SLMoreSetViewController

- (void)viewDidLoad {
    [super viewDidLoad];
  _tableViewInfo = [[PPTableViewInfo alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
  _tableViewInfo.delegate = self;
  UITableView *tableView = [_tableViewInfo getTableView];
  tableView.backgroundColor = [UIColor defeutBackgroudColor];
  tableView.tableFooterView = [UIView new];
  
  [self.view addSubview:tableView];
  [self createNormalSection];
    // Do any additional setup after loading the view.
}

- (void)viewWillAppear:(BOOL)animated{
  [super viewWillAppear:animated];
  [self.navigationController setNavigationBarHidden:NO animated:YES];
}


- (void)showOpenNotification{
  [SVProgressHUD showImage:nil status:@"消息通知 设置－通知－星星点灯－打开消息通知"];
}



- (void)shareToFriend{
  NSString *shareTitle = @"推荐个软件给你";
  NSString *sharetext = @"内河航运新码头，用心服务诚信合作，广交生意朋友的好软件";
  NSString *shareUrl = @"www.xinmatou.net";

  [UMSocialData defaultData].extConfig.wechatSessionData.title = shareTitle;
  [UMSocialData defaultData].extConfig.wechatTimelineData.title =  shareTitle;
  [UMSocialData defaultData].extConfig.wechatSessionData.url = shareUrl;
  [UMSocialData defaultData].extConfig.wechatTimelineData.url = shareUrl;
  [UMSocialData defaultData].extConfig.qqData.title = shareTitle;
  [UMSocialData defaultData].extConfig.qqData.url = shareUrl;
  [UMSocialData defaultData].extConfig.qzoneData.title = shareTitle;
  [UMSocialData defaultData].extConfig.qzoneData.url = shareUrl;
  
  

  
  [UMSocialSnsService presentSnsIconSheetView:self
                                       appKey:kUMengAppKey
                                    shareText: sharetext
                                   shareImage: [UIImage imageNamed:@"newLogo"]
                              shareToSnsNames:[NSArray arrayWithObjects:UMShareToWechatSession,UMShareToWechatTimeline,UMShareToQQ,UMShareToQzone,nil]
                                     delegate:self];
}



- (void)createNormalSection{
  PPTableViewSectionInfo *sectionInfo = [PPTableViewSectionInfo sectionInfoDefault];

  PPTableViewCellInfo *normalCellInfo3 = [PPTableViewCellInfo normalCellForSel:@selector(shareToFriend) target:self title:@"分享朋友" rightValue:@"" imageName:@"Share friends" accessoryType:UITableViewCellAccessoryNone];
  PPTableViewCellInfo *normalCellInfo4 = [PPTableViewCellInfo normalCellForSel:@selector(aboutUs) target:self title:@"关于" rightValue:@"" imageName:@"about" accessoryType:UITableViewCellAccessoryNone];
  

  [sectionInfo addCell:normalCellInfo3];
  [sectionInfo addCell:normalCellInfo4];
  
  [_tableViewInfo addSection:sectionInfo];
  
}

- (void)aboutUs{
  SLAboutViewController *aboutVC = [SLAboutViewController new];
  [self.navigationController pushViewController:aboutVC animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
